'use strict';
const db = uniCloud.database() //对数据库的对象获取；

exports.main = async (event, context) => {
    const collection = db.collection('user-list')
    // 修改数据
	let params = await collection.doc(event.user_id).set({
		time: Date.now(), //获取当前时间
		user_name: event.user_name,
		date: event.date,
		breeding_year: event.breeding_year,
		user_id: event.user_id,
		avatar: event.avatar,
	})
 
    return {
    	code: 200,
    	message: 'ok',
    	data: params
    }
}